package org.fisco.bcos.sdk.v3.test.wasm.liquid;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.v3.client.Client;
import org.fisco.bcos.sdk.v3.codec.datatypes.Function;
import org.fisco.bcos.sdk.v3.codec.datatypes.Type;
import org.fisco.bcos.sdk.v3.codec.datatypes.TypeReference;
import org.fisco.bcos.sdk.v3.codec.datatypes.Utf8String;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple1;
import org.fisco.bcos.sdk.v3.codec.scale.FunctionEncoder;
import org.fisco.bcos.sdk.v3.contract.Contract;
import org.fisco.bcos.sdk.v3.crypto.CryptoSuite;
import org.fisco.bcos.sdk.v3.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.v3.model.CryptoType;
import org.fisco.bcos.sdk.v3.model.TransactionReceipt;
import org.fisco.bcos.sdk.v3.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;
import org.fisco.bcos.sdk.v3.utils.StringUtils;

@SuppressWarnings("unchecked")
public class HelloWorld extends Contract {
    public static final String[] BINARY_ARRAY = {
        "0061736d0100000001460c60027f7f0060017f0060037f7f7f0060037f7f7f017f60047f7f7f7f006000006000017f60057f7f7f7f7f0060017f017f60027f7f017f60047f7f7f7f017f60027f7f017e026b060462636f730a73657453746f7261676500040462636f730a67657453746f7261676500030462636f730666696e69736800000462636f730672657665727400000462636f730f67657443616c6c4461746153697a6500060462636f730b67657443616c6c44617461000103302f01010002010200020902020204010404070a0b0100010001000801020000060500010500000303000002030102000305030100110609017f01418080c0000b072604066d656d6f7279020009686173685f747970650024066465706c6f790025046d61696e00280acb432f3301017f20001007200041146a2d0000410247044020002802102201280200047f2001100720002802100520010b410c10080b0b2601017f024020002802004100200028020422001b2201450d002000450d002001200010080b0b850201037f200004402001200141046a22034d4100200341016b20034d1b450440000b41b482c0002802002103200041086b220120012802002204417e71360200024002402004417c71220220006b20024d044020004100360200200041046b280200417c712202450d0120022d00004101710d01200110312002280200210020012d000041027104402002200041027222003602000b200321012000417c71220020026b41086b20004d0d020b000b02402004417c712202450d004100200220044102711b2202450d0020022d00004101710d0020002002280208417c7136020020022001410172360208200321010c010b200020033602000b41b482c00020013602000b0b4801017f024002402002200241016b2202490d0020012802081a20012802101a20012903001a20012802142203200220036a4b0d00200141003602140c010b000b200041003602000b5701037f230041106b22012400200141086a41044100100b20012802082102200128020c2103200041146a41023a0000200042043702082000200336020420002002360200200241eec2b5ab06360000200141106a24000b6601017f230041106b220324000240200141004e0440027f2002450440200341086a2001100c200328020c210220032802080c010b200320014101100d2003280204210220032802000b22010d010b000b2000200136020020002002360204200341106a24000b3301017f230041106b22022400200241086a20014100100d200020022802083602002000200228020c360204200241106a24000b4a01017f4101210302402001450440410021010c010b20014101100e21030240200204402003450d012003200110330c020b20030d010b410021030b20002001360204200020033602000b9c0101027f230041106b2202240002402000200041046a22034d0440200341016b220020034d0d010b000b20004102762100200241b482c00028020036020c0240200020012002410c6a103022030d00200220002001102f4100210320022802000d0020022802042203200228020c3602082002200336020c200020012002410c6a103021030b41b482c000200228020c360200200241106a240020030bd00101037f230041106b22032400024002400240200141004e0440200228020022040d0120032001100c20032802042104200328020021020c020b20004101360200200041086a41003602000c020b20022802042205450440200341086a20014100100d200328020c2104200328020821020c010b20014101100e2202450440410021020c010b2002200420051032200420051008200121040b2000027f200204402000200236020441000c010b200020013602044101210441010b360200200041086a20043602000b200341106a24000bd60101067f230041206b22032400024002400240200220002802042205200028020822066b4d0440200220066a220720064921080c010b200220066a220720064922080d01200520056a22042005490d0120042007200420074b1b22044108200441084b1b2104024020050440200341186a410136020020032005360214200320002802003602100c010b200341003602100b20032004200341106a100f20032802004101460d01200020032902043702000b200028020020066a2001200210322008450d010b000b20002007360208200341206a24000b4601027f230041106b22032400200341086a20024100100b200328020821042000200328020c36020420002004360200200420012002103220002002360208200341106a24000b14002001200346044020002002200110320f0b000bc60101047f024020000d0020000d00024002402000450d002000450d000c010b410021000b0340024041002000047f20000d0141000541000b22006b22020d022002450d02200041b482c0006a22002c00002203417f4a0d02200020026a220421012002410147044020002d00011a200041026a21010b200341ff017141e001490d0220042200200147047f200141016a210020012d00000541000b1a200341ff017141f001490d022000200447044020002d00001a0b0c020b200041016b21000c000b000b000bec0101067f410121074101210403400240024002402004220620056a22042006490d00200220044d0d01200520086a22092008490d00200220094d0d0002400240200120046a2d00002204200120096a2d000022094b2003710d00200420094f200372450d0020042009460d01200641016a22042006490d024101210741002105200621080c050b200541016a22042005490d01200420066a22042006490d01200420086b220720044b0d010c030b2005200541016a22054b0d002006210420052007470d032004200420076a22044d0d020b000b20002007360204200020083602000f0b410021050c000b000b3701017f230041106b22042400200441086a41002003200120021016200020042802083602002000200428020c360204200441106a24000b36000240200120024d0440200220044d04402002200220016b2204490d02200020043602042000200120036a3602000f0b000b000b000ba00201077f4101210941012104034002400240024002402004220720056a22042007490d00200120044d0d03200741016a22042007490d00200420056a22082004490d00200120086b220820014b0d00200120084d0d00200a41016a2206200a490d002006200520066a22064b0d00200120066b220620014b0d00200120064d0d0002400240200020086a2d00002208200020066a2d000022064b2003710d00200620084d200372450d0020062008460d0141012109410021052007210a0c040b200541016a22042005490d01200420076a22042007490d012004200a6b220920044b0d010c020b2005200541016a22054b0d0020052009470440200721040c030b200720096a220420074f0d010b000b410021050b20022009470d010b0b200a0b2b01017e034020010440200141016b210142012000310000862002842102200041016a21000c010b0b20020bdb0301067f230041306b22022400200241206a2000410c6a2204101a20022802242205280200220141016b220320014e21060240024002400240024020022802202d00042201410247044020060d05200520033602002001450d04200241186a210120042802000440000b2004417f360200200120043602042001200441046a360200200228021c2105200228021822012d00044102460440000b20012802002201410020012802001b2203450d0341b882c000410036020020002802082106200028020021012003280200210020032802082203413f4d04402003410274101b0c030b200341ffff004d0440200220034102744101723b012e2002412e6a4102101c0c030b200341ffffffff034b0d012003410274410272101d0c020b20060d04200520033602000c030b4103101b2003101d0b20002003101c200241106a41b882c000280200101e200120062002280210200228021410000b2005280200220141016a22002001480d0120052000360200200241086a210020042802000440000b2004417f360200200020043602042000200441046a360200200228020c2101200228020822002d00044102470440200041003a00040b2001280200220441016a22002004480d01200120003602000b200241306a24000f0b000b2d01017f200128020041016a220241004c0440000b20012002360200200020013602042000200141046a3602000b2401017f230041106b22012400200120003a000f2001410f6a4101101c200141106a24000b7101037f230041106b220224000240024041b882c000280200220320016a22042003490d002004418080014b0d00200241086a2003200410212002280208200228020c20002001101241b882c000280200220020016a220120004f0d010b000b41b882c0002001360200200241106a24000b2401017f230041106b220124002001200036020c2001410c6a4104101c200141106a24000b4b01027f230041106b22022400200241086a21032001418080014b0440000b20032001360204200341bc82c000360200200020022802083602002000200228020c360204200241106a24000b260020001020200041106a22002d00044102460440000b20002802002200410020002802001b0bc70202057f017e230041406a22012400200141206a2000410c6a2204101a024020012802242202280200220341016b220520034e0d0020012802202d000420022005360200410246044020002802082103200028020041002102200141186a410041b882c0002802001021200320012802181001220004402000418180014f0d0241b882c0002000360200200141106a2000101e200141086a210220012802102103200020012802144b0440000b200220003602042002200336020020012001290308370338200141286a200141386a1022200129022c2106200128022821020b200422002802000440000b2000417f360200200120003602042001200041046a3602002001280204210020012802002001200637022c20012002360228200141286a10232000280200220441016a22022004480d01200020023602000b200141406b24000f0b000b3d01017f0240200120024d04402002418080014d04402002200220016b2203490d02200020033602042000200141bc82c0006a3602000f0b000b000b000b8a0902087f037e230041206b22032400200341003a00080240024002400240027e0240024002402001200341086a4101102b0d00024020032d0008220241037122044103470440024002400240200441016b0e020201000b200241027621020c030b200320023a000d200341013a000c200320013602082003410036021c200341086a2003411c6a4104102c0d03200328021c220241ffff034d0d03200241027621020c020b200320023a000d200341013a000c20032001360208200341003b011c200341086a2003411c6a4102102c0d0220032f011c220241ff014d0d02200241027621020c010b200241044f0d01200341003602082001200341086a4104102b0d012003280208220241ffffffff034d0d01",
        "0b20012802042002490d00200341086a2002102a2001200328020822042003280210102b0440200341086a10070c010b4100200329020c220c422088a7220541076b2201200120054b1b2109200441036a417c7120046b2108410021010340200120054f0d07024002400240200120046a2d00002206411874411875220741004e04402008417f460d03200820016b4103710d030340200120094f0d03200120046a220241046a280200200228020072418081828478710d032001200141086a22014d0d000b0c010b42808080808020210a428080808010210b024002400240024002402006418080406b2d000041026b0e030002010e0b200141016a22022005490d024200210a0c0c0b4200210a200141016a220220054f0d0b200220046a2d000021020240024002400240200641f0016b0e050100000002000b200241bf014b0d0c2007410f6a41ff017141024b0d0c200241187441187541004e0d0c0c020b200241f0006a41ff017141304f0d0b0c010b2002411874411875417f4a0d0a2002418f014b0d0a0b200141026a220220054f0d0b200220046a2d000041c00171418001470d084200210b200141036a220220054f0d0c200220046a2d000041c00171418001460d02428080808080e0000c0a0b4200210a200141016a220220054f0d0a200220046a2d00002102024002400240200641e001470440200641ed01460d012007411f6a41ff0171410c490d02200241bf014b0d0c200741fe017141ee01470d0c200241187441187541004e0d0c0c030b200241e0017141a001470d0b0c020b2002411874411875417f4a0d0a200241a0014f0d0a0c010b2002411874411875417f4a0d09200241bf014b0d090b4200210b200141026a220220054f0d0b200220046a2d000041c00171418001470d070c010b200220046a2d000041c00171418001470d0a0b200241016a21010c030b000b20012005200120054b1b2102034020012002460440200221010c030b200120046a2c00004100480d02200141016a21010c000b000b200141016a21010c000b000b200041003602000c060b428080808080c0000c010b428080808080200b210a428080808010210b0c010b4200210b0b2001ad200a200b8484210a0b200120054f04402000200c370204200020043602000c010b2003200a3702142003200c37020c20032004360208200341086a1007200041003602000b200341206a24000ba00101027f230041106b220324000240024020002d00044102460440410c4104100e2202450d02200041003a00042000200236020020022001290200370200200241086a200141086a2802003602000c010b200341086a2202200141086a28020036020020032001290200370300200028020022002802000440200010070b20002003290300370200200041086a20022802003602000b200341106a24000f0b000b040041000bbd0402057f017e230041a0016b22002400200041186a100a200041306a4100102602400240024020002d0030450440200041d0006a2000413c6a29020037030020002000290234370348200041e0006a200041d4006a28020022013602002000200029024c22053703582000200136026c200020053e026820004190016a200041e8006a1022200028029001450d02200041f8006a20004198016a28020022013602002000200029039001220537037020004188016a200136020020002005370380010240200041186a101f450440200041106a2103200041246a220122022802000440000b2002417f360200200320023602042003200241046a36020020002802142102200028021020004198016a200041f8006a280200360200200020002903703703900120004190016a10232002280200220341016a22042003480d0520022004360200200041086a210220012802000440000b2001417f360200200220013602042002200141046a360200200028020c2101200028020822022d00044102470440200241013a00040b2001280200220241016a22032002480d05200120033602000c010b20004180016a10070b200041186a1019200041d8006a10070c010b200041c8006a419e82c00041141011200041c8006a1027200041c8006a10070b200041186a10072000412c6a2d0000410247044020002802282201280200047f2001100720002802280520010b410c10080b200041a0016a24000f0b230041106b220124002001419082c000410e10112001102720011007000b000b970201027f230041306b22022400024002401004220341034b0d002001450d0020004181083b01000c010b20022003102a2002280200220310052000027f02402001044020022002280208220136021420022003360210024020014104490d002002410036021c200241106a2002411c6a4104102b0d00200241206a2002280214102a200241106a200228022022012002280228102b450d02200241206a10070b200041003a000141010c020b200041003a0000200041046a4100360200200041086a2002290300370200200041106a200241086a2802003602000c020b200228021c21032000410c6a2002290224370200200041086a2001360200200041046a200336020041000b3a0000200210070b200241306a24000b2a01017f230041106b2201240020012000102920012802002001280208100320011007200141106a24000b870b02087f017e230041f0016b22002400200041406b100a200041b0016a410110260240024002400240024020002d00b0014101470440200041e0006a200041c0016a28020022023602002000200041b8016a290300220837035820002802b4012101200041f0006a200236020020002008370368027f0240200141c4a58a987e4704400240200141ed9899e703470440200141cea6a3f405470d012000200028027036027c20002000280268360278200041a0016a200041f8006a102220002802a001450d0320004188016a200041a8016a280200360200200020002903a00137038001200041406b1020200041d4006a2d00004102460d09200041013a0054200041d0006a2802002201280200450d0920011007200141086a20004188016a2802003602002001200029038001370200200041406b101941030c040b200041406b101f2201450d0820012802002102200041086a200128020822014100100b2000200028020c360294012000200028020822053602900120052002200110322000200136029801200041b0016a20004190016a102920002802b00120002802b8011002200041b0016a100720004190016a100741030c030b200041e8006a1007200041406b1006418082c0002102411021010c050b2000200028027036027c20002000280268360278200041a0016a200041f8006a102220002802a001450d0020004188016a200041a8016a22012802002203360200200020002903a00122083703800120012003360200200020083703a0012008a72106027f20030440200041386a2006200341001014200028023c20002802382101200041306a20062003410110142000280234200041286a20062003200120002802302204200120044b22041b2201101520041b220420016a22072004490d08200028022c210220002802282105200041206a20042007200620031016027f200028022021072000280224200246047f2005200720021034450541000b450440200320016b220220034b0d0a20012002200120024b1b220241016a22042002490d0a417f2105200620031018210820012102417f0c010b410021052003200620032004410010172202200620032004410110172207200220074b1b6b220220034b0d09200041186a20062003200410152000280218200028021c1018210820030b2107200041ec016a2003360200200041e4016a4100360200200041d8016a2007360200200041d4016a2005360200200041cc016a4200370200200041c8016a2004360200200041c4016a2002360200200041c0016a2001360200200041b8016a2008370300200020063602e801200041b482c0003602e001200041013602b0012008422088a7210120030c010b200041ec016a4100360200200041e4016a4100360200200041bc016a4181023b0100200041b8016a4100360200200020063602e801200041b482c0003602e001200042003703b0014101210141000b2102024020030440200041b8016a2101200041d4016a280200417f47044020004190016a2001200210090c020b20004190016a2001200210090c010b20002802b40122020d08200141ff0171044020004198016a2002360200200020023602940120004101360290010c010b20004100360290010b2000280290012101200041a0016a1007200041106a41014100100b200041003602b801200020002903103703b001200020013a009001200041b0016a20004190016a4101101020002802b00120002802b8011002200041b0016a100741030c010b41010b2105200041e8006a1007200041406b1006418082c0002102411021010240200541016b0e03000204030b419082c0002102410e21010c020b200041406b10060b419e82c0002102411421010b200041b0016a200220011011200041b0016a1027200041b0016a10070b200041f0016a24000f0b000b20021013000bb70102037f017e230041106b22032400024002402001280208220241046a220420024f044020012802002101200320044100100b2003290300210520004100360208200020053702002002413f4d044020002002410274102d0c030b200241ffff004d0440200320024102744101723b010e20002003410e6a410210100c030b200241ffffffff034b0d0120024102744102722000102e0c020b000b20004103102d20022000102e0b2000200120021010200341106a24000b3602017f017e230041106b22022400200241086a20014101100b200229030821032000200136020820002003370200200241106a24000b3901027f2000280204220320024922044504402001200220002802002201200210122000200320026b3602042000200120026a3602000b20040b4201017f20002f01042103200041003a00042003410171450440200028020020012002102b0f0b200120034108763a00002000280200200141016a200241016b102b0b2601017f230041106b22022400200220013a000f20002002410f6a41011010200241106a24000b2601017f230041106b220224002002200036020c20012002410c6a41041010200241106a24000bd20101017f0240200141ffffffff03712001470d002002200241406b22034b0d00200341ffffffff01712003470d002001410274220120034103742202200120024b1b220241086a22012002490d00027f024020012001418080046a22024d0440200241016b220120024d0d010b000b2001411076220240002201417f4604404100210141010c010b200141ffff03712001470d012002411074220241086b20024b0d012001411074220142003702042001200120026a41027236020041000b210220002001360204200020023602000f0b000baf04010a7f20004102742106410020016b2108200041ffffffff03712000472109200141016b220a20014b210b20022802002100024003402000450d01200021010240034002",
        "402001280208220041017145044020090d032001280200417c712203200141086a22056b220420034b0d0320042006490d01200320066b220c20034b0d03200b0d03200541086a22042005490d032004200441406b22044b0d03024020042008200c7122044b04402005200a710d0320022000417c7136020020012001280200410172360200200121000c010b200441086b220020044b0d04200320006b220220034b0d04200241086b20024b0d04200041003602082000420037020020002001280200417c71360200024020012802002202417c712203450d004100200320024102711b2202450d00200220022802044103712000723602040b2000200028020441037120017236020420012001280208417e71360208200120012802002202410371200072220336020002402002410271450440200028020021010c010b20012003417d713602002000200028020041027222013602000b200020014101723602000b200041086a21070c050b20012000417e71360208027f41002001280204417c712200450d001a4100200020002d00004101711b0b21002001103120012d00004102710440200020002802004102723602000b200220003602002000280200417c71220120006b41086b20014b0d02200021010c010b0b200220003602000c010b0b000b20070b7d01027f024020002802002201417c712202450d004100200220014102711b2201450d00200120012802044103712000280204417c71723602040b200020002802042201417c712202047f200220022802004103712000280200417c717236020020002802040520010b410371360204200020002802004103713602000b2801017f034020022003470440200020036a200120036a2d00003a0000200341016a21030c010b0b0b2201017f034020012002470440200020026a41003a0000200241016a21020c010b0b0b3f01027f0340200245044041000f0b200241016b210220012d0000210320002d00002104200041016a2100200141016a210120032004460d000b200420036b0b0bff010300418080c0000b800101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010041c281c0000b3302020202020202020202020202020202020202020202020202020202020203030303030303030303030303030303040404040400418082c0000b32756e6b6e6f776e2073656c6563746f72696e76616c696420706172616d73636f756c64206e6f74207265616420696e70757400fd01046e616d6501f50135000966696d706f72742430010966696d706f72742431020966696d706f72742432030966696d706f72742433040966696d706f72742434050966696d706f727424350601300701310801320901330a01340b01350c01360d01370e01380f0139100231301102313112023132130231341402313715023138160231391702323218023233190232341a0232351b0232381c0232391d0233301e0233311f023332200233332102333422023336230233372402333825023339260234302702343128023435290234362a0234372b0234382c0234392d0235302e0235312f0235343002353531023536320235373302353834023539"
    };

    public static final String BINARY = StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {
        "0061736d0100000001460c60027f7f0060017f0060037f7f7f0060037f7f7f017f60047f7f7f7f006000006000017f60057f7f7f7f7f0060017f017f60027f7f017f60047f7f7f7f017f60027f7f017e026b060462636f730a73657453746f7261676500040462636f730666696e69736800000462636f730672657665727400000462636f730a67657453746f7261676500030462636f730f67657443616c6c4461746153697a6500060462636f730b67657443616c6c44617461000103302f01010002010200020902020204010404070a0b0100010001000605000008000105010002000303000002030102000305030100110609017f01418080c0000b072604066d656d6f7279020009686173685f74797065001f066465706c6f790020046d61696e00260acd432f3301017f20001007200041146a2d0000410247044020002802102201280200047f2001100720002802100520010b410c10080b0b2601017f024020002802004100200028020422001b2201450d002000450d002001200010080b0b850201037f200004402001200141046a22034d4100200341016b20034d1b450440000b41b482c0002802002103200041086b220120012802002204417e71360200024002402004417c71220220006b20024d044020004100360200200041046b280200417c712202450d0120022d00004101710d01200110312002280200210020012d000041027104402002200041027222003602000b200321012000417c71220020026b41086b20004d0d020b000b02402004417c712202450d004100200220044102711b2202450d0020022d00004101710d0020002002280208417c7136020020022001410172360208200321010c010b200020033602000b41b482c00020013602000b0b4801017f024002402002200241016b2202490d0020012802081a20012802101a20012903001a20012802142203200220036a4b0d00200141003602140c010b000b200041003602000b5701037f230041106b22012400200141086a41044100100b20012802082102200128020c2103200041146a41023a0000200042043702082000200336020420002002360200200241eec2b5ab06360000200141106a24000b6601017f230041106b220324000240200141004e0440027f2002450440200341086a2001100c200328020c210220032802080c010b200320014101100d2003280204210220032802000b22010d010b000b2000200136020020002002360204200341106a24000b3301017f230041106b22022400200241086a20014100100d200020022802083602002000200228020c360204200241106a24000b4a01017f4101210302402001450440410021010c010b20014101100e21030240200204402003450d012003200110330c020b20030d010b410021030b20002001360204200020033602000b9c0101027f230041106b2202240002402000200041046a22034d0440200341016b220020034d0d010b000b20004102762100200241b482c00028020036020c0240200020012002410c6a103022030d00200220002001102f4100210320022802000d0020022802042203200228020c3602082002200336020c200020012002410c6a103021030b41b482c000200228020c360200200241106a240020030bd00101037f230041106b22032400024002400240200141004e0440200228020022040d0120032001100c20032802042104200328020021020c020b20004101360200200041086a41003602000c020b20022802042205450440200341086a20014100100d200328020c2104200328020821020c010b20014101100e2202450440410021020c010b2002200420051032200420051008200121040b2000027f200204402000200236020441000c010b200020013602044101210441010b360200200041086a20043602000b200341106a24000bd60101067f230041206b22032400024002400240200220002802042205200028020822066b4d0440200220066a220720064921080c010b200220066a220720064922080d01200520056a22042005490d0120042007200420074b1b22044108200441084b1b2104024020050440200341186a410136020020032005360214200320002802003602100c010b200341003602100b20032004200341106a100f20032802004101460d01200020032902043702000b200028020020066a2001200210322008450d010b000b20002007360208200341206a24000b4601027f230041106b22032400200341086a20024100100b200328020821042000200328020c36020420002004360200200420012002103220002002360208200341106a24000b14002001200346044020002002200110320f0b000bc60101047f024020000d0020000d00024002402000450d002000450d000c010b410021000b0340024041002000047f20000d0141000541000b22006b22020d022002450d02200041b482c0006a22002c00002203417f4a0d02200020026a220421012002410147044020002d00011a200041026a21010b200341ff017141e001490d0220042200200147047f200141016a210020012d00000541000b1a200341ff017141f001490d022000200447044020002d00001a0b0c020b200041016b21000c000b000b000bec0101067f410121074101210403400240024002402004220620056a22042006490d00200220044d0d01200520086a22092008490d00200220094d0d0002400240200120046a2d00002204200120096a2d000022094b2003710d00200420094f200372450d0020042009460d01200641016a22042006490d024101210741002105200621080c050b200541016a22042005490d01200420066a22042006490d01200420086b220720044b0d010c030b2005200541016a22054b0d002006210420052007470d032004200420076a22044d0d020b000b20002007360204200020083602000f0b410021050c000b000b3701017f230041106b22042400200441086a41002003200120021016200020042802083602002000200428020c360204200441106a24000b36000240200120024d0440200220044d04402002200220016b2204490d02200020043602042000200120036a3602000f0b000b000b000ba00201077f4101210941012104034002400240024002402004220720056a22042007490d00200120044d0d03200741016a22042007490d00200420056a22082004490d00200120086b220820014b0d00200120084d0d00200a41016a2206200a490d002006200520066a22064b0d00200120066b220620014b0d00200120064d0d0002400240200020086a2d00002208200020066a2d000022064b2003710d00200620084d200372450d0020062008460d0141012109410021052007210a0c040b200541016a22042005490d01200420076a22042007490d012004200a6b220920044b0d010c020b2005200541016a22054b0d0020052009470440200721040c030b200720096a220420074f0d010b000b410021050b20022009470d010b0b200a0b2b01017e034020010440200141016b210142012000310000862002842102200041016a21000c010b0b20020b2401017f230041106b220124002001200036020c2001410c6a4104101a200141106a24000b7101037f230041106b220224000240024041b882c000280200220320016a22042003490d002004418080014b0d00200241086a2003200410292002280208200228020c20002001101241b882c000280200220020016a220120004f0d010b000b41b882c0002001360200200241106a24000bdb0301067f230041306b22022400200241206a2000410c6a2204101c20022802242205280200220141016b220320014e21060240024002400240024020022802202d00042201410247044020060d05200520033602002001450d04200241186a210120042802000440000b2004417f360200200120043602042001200441046a360200200228021c2105200228021822012d00044102460440000b20012802002201410020012802001b2203450d0341b882c000410036020020002802082106200028020021012003280200210020032802082203413f4d04402003410274101d0c030b200341ffff004d0440200220034102744101723b012e2002412e6a4102101a0c030b200341ffffffff034b0d01200341027441027210190c020b20060d04200520033602000c030b4103101d200310190b20002003101a200241106a41b882c000280200101e200120062002280210200228021410000b2005280200220141016a22002001480d0120052000360200200241086a210020042802000440000b2004417f360200200020043602042000200441046a360200200228020c2101200228020822002d00044102470440200041003a00040b2001280200220441016a22002004480d01200120003602000b200241306a24000f0b000b2d01017f200128020041016a220241004c0440000b20012002360200200020013602042000200141046a3602000b2401017f230041106b22012400200120003a000f2001410f6a4101101a200141106a24000b4b01027f230041106b22022400200241086a21032001418080014b0440000b20032001360204200341bc82c000360200200020022802083602002000200228020c360204200241106a24000b040041010bbd0402057f017e230041a0016b22002400200041186a100a200041306a4100102102400240024020002d0030450440200041d0006a2000413c6a29020037030020002000290234370348200041e0006a200041d4006a28020022013602002000200029024c22053703582000200136026c200020053e026820004190016a200041e8006a1022200028029001450d02200041f8006a20004198016a28020022013602002000200029039001220537037020004188016a200136020020002005370380010240200041186a1023450440200041106a2103200041246a220122022802000440000b2002417f360200200320023602042003200241046a36020020002802142102200028021020004198016a200041f8006a280200360200200020002903703703900120004190016a10242002280200220341016a22042003480d0520022004360200200041086a210220012802000440000b2001417f360200200220013602042002200141046a360200200028020c2101200028020822022d00044102470440200241013a00040b2001280200220241016a22032002480d05200120033602000c010b20004180016a10070b200041186a101b200041d8006a10070c010b200041c8006a419e82c00041141011200041c8006a1025200041c8006a10070b200041186a10072000412c6a2d0000410247044020002802282201280200047f2001100720002802280520010b410c10080b200041a0016a24000f0b230041106b220124002001419082c000410e10112001102520011007000b000b970201027f230041306b22022400024002401004220341034b0d002001450d0020004181083b01000c010b20022003102a2002280200220310052000027f02402001044020022002280208220136021420022003360210024020014104490d002002410036021c200241106a2002411c6a4104102b0d00200241206a2002",
        "280214102a200241106a200228022022012002280228102b450d02200241206a10070b200041003a000141010c020b200041003a0000200041046a4100360200200041086a2002290300370200200041106a200241086a2802003602000c020b200228021c21032000410c6a2002290224370200200041086a2001360200200041046a200336020041000b3a0000200210070b200241306a24000b8a0902087f037e230041206b22032400200341003a00080240024002400240027e0240024002402001200341086a4101102b0d00024020032d0008220241037122044103470440024002400240200441016b0e020201000b200241027621020c030b200320023a000d200341013a000c200320013602082003410036021c200341086a2003411c6a4104102c0d03200328021c220241ffff034d0d03200241027621020c020b200320023a000d200341013a000c20032001360208200341003b011c200341086a2003411c6a4102102c0d0220032f011c220241ff014d0d02200241027621020c010b200241044f0d01200341003602082001200341086a4104102b0d012003280208220241ffffffff034d0d010b20012802042002490d00200341086a2002102a2001200328020822042003280210102b0440200341086a10070c010b4100200329020c220c422088a7220541076b2201200120054b1b2109200441036a417c7120046b2108410021010340200120054f0d07024002400240200120046a2d00002206411874411875220741004e04402008417f460d03200820016b4103710d030340200120094f0d03200120046a220241046a280200200228020072418081828478710d032001200141086a22014d0d000b0c010b42808080808020210a428080808010210b024002400240024002402006418080406b2d000041026b0e030002010e0b200141016a22022005490d024200210a0c0c0b4200210a200141016a220220054f0d0b200220046a2d000021020240024002400240200641f0016b0e050100000002000b200241bf014b0d0c2007410f6a41ff017141024b0d0c200241187441187541004e0d0c0c020b200241f0006a41ff017141304f0d0b0c010b2002411874411875417f4a0d0a2002418f014b0d0a0b200141026a220220054f0d0b200220046a2d000041c00171418001470d084200210b200141036a220220054f0d0c200220046a2d000041c00171418001460d02428080808080e0000c0a0b4200210a200141016a220220054f0d0a200220046a2d00002102024002400240200641e001470440200641ed01460d012007411f6a41ff0171410c490d02200241bf014b0d0c200741fe017141ee01470d0c200241187441187541004e0d0c0c030b200241e0017141a001470d0b0c020b2002411874411875417f4a0d0a200241a0014f0d0a0c010b2002411874411875417f4a0d09200241bf014b0d090b4200210b200141026a220220054f0d0b200220046a2d000041c00171418001470d070c010b200220046a2d000041c00171418001470d0a0b200241016a21010c030b000b20012005200120054b1b2102034020012002460440200221010c030b200120046a2c00004100480d02200141016a21010c000b000b200141016a21010c000b000b200041003602000c060b428080808080c0000c010b428080808080200b210a428080808010210b0c010b4200210b0b2001ad200a200b8484210a0b200120054f04402000200c370204200020043602000c010b2003200a3702142003200c37020c20032004360208200341086a1007200041003602000b200341206a24000b260020001027200041106a22002d00044102460440000b20002802002200410020002802001b0ba00101027f230041106b220324000240024020002d00044102460440410c4104100e2202450d02200041003a00042000200236020020022001290200370200200241086a200141086a2802003602000c010b200341086a2202200141086a28020036020020032001290200370300200028020022002802000440200010070b20002003290300370200200041086a20022802003602000b200341106a24000f0b000b2a01017f230041106b2201240020012000102820012802002001280208100220011007200141106a24000b890b02087f017e230041f0016b22002400200041406b100a200041b0016a410110210240024002400240024020002d00b0014101470440200041e0006a200041c0016a28020022023602002000200041b8016a290300220837035820002802b4012101200041f0006a200236020020002008370368027f024002400240200141b5a0d2fd79470440200141a9befeeb79460d01200141c6d98aaa03460d02200041e8006a1007200041406b1006418082c0002102411021010c070b2000200028027036027c20002000280268360278200041a0016a200041f8006a102220002802a001450d0220004188016a200041a8016a280200360200200020002903a00137038001200041406b1027200041d4006a2d00004102460d08200041013a0054200041d0006a2802002201280200450d0820011007200141086a20004188016a2802003602002001200029038001370200200041406b101b41030c030b200041406b10232201450d0720012802002102200041086a200128020822014100100b2000200028020c360294012000200028020822053602900120052002200110322000200136029801200041b0016a20004190016a102820002802b00120002802b8011001200041b0016a100720004190016a100741030c020b2000200028027036027c20002000280268360278200041a0016a200041f8006a102220002802a001450d0020004188016a200041a8016a22012802002203360200200020002903a00122083703800120012003360200200020083703a0012008a72106027f20030440200041386a2006200341001014200028023c20002802382101200041306a20062003410110142000280234200041286a20062003200120002802302204200120044b22041b2201101520041b220420016a22072004490d08200028022c210220002802282105200041206a20042007200620031016027f200028022021072000280224200246047f2005200720021034450541000b450440200320016b220220034b0d0a20012002200120024b1b220241016a22042002490d0a417f2105200620031018210820012102417f0c010b410021052003200620032004410010172202200620032004410110172207200220074b1b6b220220034b0d09200041186a20062003200410152000280218200028021c1018210820030b2107200041ec016a2003360200200041e4016a4100360200200041d8016a2007360200200041d4016a2005360200200041cc016a4200370200200041c8016a2004360200200041c4016a2002360200200041c0016a2001360200200041b8016a2008370300200020063602e801200041b482c0003602e001200041013602b0012008422088a7210120030c010b200041ec016a4100360200200041e4016a4100360200200041bc016a4181023b0100200041b8016a4100360200200020063602e801200041b482c0003602e001200042003703b0014101210141000b2102024020030440200041b8016a2101200041d4016a280200417f47044020004190016a2001200210090c020b20004190016a2001200210090c010b20002802b40122020d08200141ff0171044020004198016a2002360200200020023602940120004101360290010c010b20004100360290010b2000280290012101200041a0016a1007200041106a41014100100b200041003602b801200020002903103703b001200020013a009001200041b0016a20004190016a4101101020002802b00120002802b8011001200041b0016a100741030c010b41010b2105200041e8006a1007200041406b1006418082c0002102411021010240200541016b0e03000204030b419082c0002102410e21010c020b200041406b10060b419e82c0002102411421010b200041b0016a200220011011200041b0016a1025200041b0016a10070b200041f0016a24000f0b000b20021013000bc70202057f017e230041406a22012400200141206a2000410c6a2204101c024020012802242202280200220341016b220520034e0d0020012802202d000420022005360200410246044020002802082103200028020041002102200141186a410041b882c0002802001029200320012802181003220004402000418180014f0d0241b882c0002000360200200141106a2000101e200141086a210220012802102103200020012802144b0440000b200220003602042002200336020020012001290308370338200141286a200141386a1022200129022c2106200128022821020b200422002802000440000b2000417f360200200120003602042001200041046a3602002001280204210020012802002001200637022c20012002360228200141286a10242000280200220441016a22022004480d01200020023602000b200141406b24000f0b000bb70102037f017e230041106b22032400024002402001280208220241046a220420024f044020012802002101200320044100100b2003290300210520004100360208200020053702002002413f4d044020002002410274102d0c030b200241ffff004d0440200320024102744101723b010e20002003410e6a410210100c030b200241ffffffff034b0d0120024102744102722000102e0c020b000b20004103102d20022000102e0b2000200120021010200341106a24000b3d01017f0240200120024d04402002418080014d04402002200220016b2203490d02200020033602042000200141bc82c0006a3602000f0b000b000b000b3602017f017e230041106b22022400200241086a20014101100b200229030821032000200136020820002003370200200241106a24000b3901027f2000280204220320024922044504402001200220002802002201200210122000200320026b3602042000200120026a3602000b20040b4201017f20002f01042103200041003a00042003410171450440200028020020012002102b0f0b200120034108763a00002000280200200141016a200241016b102b0b2601017f230041106b22022400200220013a000f20002002410f6a41011010200241106a24000b2601017f230041106b220224002002200036020c20012002410c6a41041010200241106a24000bd20101017f0240200141ffffffff03712001470d002002200241406b22034b0d00200341ffffffff01712003470d002001410274220120034103742202200120024b1b220241086a22012002490d00027f024020012001418080046a22024d0440200241016b220120024d0d010b000b2001411076220240002201417f4604404100210141010c010b200141ffff03712001470d012002411074220241086b20024b0d012001411074220142003702042001200120026a41027236020041000b210220002001360204200020023602000f0b000baf04010a7f20004102742106410020016b2108200041ffffffff03712000472109200141016b220a20014b210b20022802002100024003402000450d0120002101024003",
        "4002402001280208220041017145044020090d032001280200417c712203200141086a22056b220420034b0d0320042006490d01200320066b220c20034b0d03200b0d03200541086a22042005490d032004200441406b22044b0d03024020042008200c7122044b04402005200a710d0320022000417c7136020020012001280200410172360200200121000c010b200441086b220020044b0d04200320006b220220034b0d04200241086b20024b0d04200041003602082000420037020020002001280200417c71360200024020012802002202417c712203450d004100200320024102711b2202450d00200220022802044103712000723602040b2000200028020441037120017236020420012001280208417e71360208200120012802002202410371200072220336020002402002410271450440200028020021010c010b20012003417d713602002000200028020041027222013602000b200020014101723602000b200041086a21070c050b20012000417e71360208027f41002001280204417c712200450d001a4100200020002d00004101711b0b21002001103120012d00004102710440200020002802004102723602000b200220003602002000280200417c71220120006b41086b20014b0d02200021010c010b0b200220003602000c010b0b000b20070b7d01027f024020002802002201417c712202450d004100200220014102711b2201450d00200120012802044103712000280204417c71723602040b200020002802042201417c712202047f200220022802004103712000280200417c717236020020002802040520010b410371360204200020002802004103713602000b2801017f034020022003470440200020036a200120036a2d00003a0000200341016a21030c010b0b0b2201017f034020012002470440200020026a41003a0000200241016a21020c010b0b0b3f01027f0340200245044041000f0b200241016b210220012d0000210320002d00002104200041016a2100200141016a210120032004460d000b200420036b0b0bff010300418080c0000b800101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010041c281c0000b3302020202020202020202020202020202020202020202020202020202020203030303030303030303030303030303040404040400418082c0000b32756e6b6e6f776e2073656c6563746f72696e76616c696420706172616d73636f756c64206e6f74207265616420696e70757400fd01046e616d6501f50135000966696d706f72742430010966696d706f72742431020966696d706f72742432030966696d706f72742433040966696d706f72742434050966696d706f727424350601300701310801320901330a01340b01350c01360d01370e01380f0139100231301102313112023132130231341402313715023138160231391702323218023233190232341a0232351b0232361c0232371d0233301e0233311f023332200233332102333422023335230233362402333725023338260234322702343328023434290234352a0234372b0234382c0234392d0235302e0235312f0235343002353531023536320235373302353834023539"
    };

    public static final String SM_BINARY = StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {
        "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"type\":\"constructor\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"internalType\":\"string\",\"type\":\"string\"}],\"type\":\"function\"}]"
    };

    public static final String ABI = StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_SET = "set";

    public static final String FUNC_GET = "get";

    protected HelloWorld(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public static String getABI() {
        return ABI;
    }

    public TransactionReceipt set(String name) {
        final Function function =
                new Function(
                        FUNC_SET,
                        Arrays.<Type>asList(new Utf8String(name)),
                        Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void set(String name, TransactionCallback callback) {
        final Function function =
                new Function(
                        FUNC_SET,
                        Arrays.<Type>asList(new Utf8String(name)),
                        Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForSet(String name) {
        final Function function =
                new Function(
                        FUNC_SET,
                        Arrays.<Type>asList(new Utf8String(name)),
                        Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple1<String> getSetInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function =
                new Function(
                        FUNC_SET,
                        Arrays.<Type>asList(),
                        Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        List<Type> results =
                this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<String>((String) results.get(0).getValue());
    }

    public String get() throws ContractException {
        final Function function =
                new Function(
                        FUNC_GET,
                        Arrays.<Type>asList(),
                        Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeCallWithSingleValueReturn(function, String.class);
    }

    public static HelloWorld load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new HelloWorld(contractAddress, client, credential);
    }

    public static HelloWorld deploy(
            Client client, CryptoKeyPair credential, String contractPath, String name)
            throws ContractException {
        byte[] encodedConstructor =
                FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Utf8String(name)));
        return deploy(
                HelloWorld.class,
                client,
                credential,
                getBinary(client.getCryptoSuite()),
                getABI(),
                encodedConstructor,
                contractPath);
    }
}
